package client.gui;

import javax.swing.JFrame;

import client.control.ClientControl;

import entity.Constants;

public class ClientFrame extends JFrame {

	/**
	 * 
	 */
	private static final long serialVersionUID = -6848627110644156802L;
	
	public ClientControl cc;

	public ClientFrame(ClientControl cctrl) {
		
		cc = cctrl;
		
		this.setSize(Constants.CLIENT_WIDTH, Constants.CLIENT_HEIGHT);
		this.setVisible(true);
		this.setDefaultCloseOperation(EXIT_ON_CLOSE);
		
		initComponents();
	}
	
	private void initComponents() {
		ConnectPanel cpanel = new ConnectPanel();
		APoolPanel appanel = new APoolPanel();
		
		cpanel.cc = cc;
		cpanel.appanel = appanel;
		
		//default visible
		cpanel.setVisible(true);
		appanel.setVisible(false);
		
		//set location for panel
		cpanel.setLocation(50, 195);
		
		this.add(cpanel);
		this.add(appanel);
	}
}
